package cn.gjculture.shopping.api;


import java.io.*;

public class Statistics {
   static long rowCount=0;
   static long fileCount=0;

    public static void main(String[] args) throws IOException {
        String path="D:\\works\\guojiang\\shopping-mgr\\src";
        File file=new File(path);
        st(file);
        System.out.println(rowCount);
        System.out.println(fileCount);
    }

    public static void st(File file) throws IOException {
        if(file.isFile()){
            fileCount+=1;
            BufferedReader reader=new BufferedReader(new FileReader(file));
            while (true){
                String temp=reader.readLine();
                if(temp==null){
                    break;
                }else {
                    if(!temp.trim().equals("")){
                        System.out.println(temp);
                        rowCount+=1;
                    }else{
                        continue;
                    }
                }

            }
        }else if(file.isDirectory()){
            for (File f:file.listFiles()){
                st(f);
            }
        }

    }
}
